#include "grflib_stdafx.h"
#include <boost/functional/hash.hpp>
#include "../include/Hash.h"

std::size_t hash_value(const D3D10_INPUT_ELEMENT_DESC &desc)
{
	std::size_t seed = 0;
	boost::hash_range(seed, desc.SemanticName, desc.SemanticName + strlen(desc.SemanticName));
	boost::hash_combine(seed, desc.SemanticIndex);
	boost::hash_combine(seed, desc.InputSlot);
	boost::hash_combine(seed, desc.InputSlotClass);
	boost::hash_combine(seed, desc.Format);
	boost::hash_combine(seed, desc.AlignedByteOffset);
	return seed;
}

std::size_t hash_value(const D3D10_SIGNATURE_PARAMETER_DESC &desc)
{
	std::size_t seed = 0;
	boost::hash_range(seed, desc.SemanticName, desc.SemanticName + strlen(desc.SemanticName));
	boost::hash_combine(seed, desc.SemanticIndex);
	boost::hash_combine(seed, desc.Register);
	boost::hash_combine(seed, desc.SystemValueType);
	boost::hash_combine(seed, desc.ComponentType);
	boost::hash_combine(seed, desc.Mask);
	boost::hash_combine(seed, desc.ReadWriteMask);
	
	return seed;
}